
/**
 * 整个海报的宽 (预设)
 */
const PANEL_WIDTH = 1200;
const FOOTER_HEIGHT = 300;


/* **********
 *   表头   *
 ********** */
const TABLE_HEADER_Y = 264;
const TABLE_HEADER_HEIGHT = 165;
const TABLE_HEADER_PADDING_TOP_BOTTOM = 25;

const TABLE_HEADER_TEXT_HEIGHT = 102;
const TABLE_HEADER_FONT_SIZE = 28;
const TABLE_HEADER_TEXT_PADDING_RIGHT = 2;
const TABLE_HEADER_ICON_OPACITY = 0.8;

/**
 * 相对于 TABLE_HEADER 的位置
 */
const TABLE_HEADER_TEXT_Y = 0;
const TABLE_HEADER_ICON_Y = 150;
const TABLE_FOOTER_TEXT_Y = 63;
const TABLE_FOOTER_ICON_Y = 15;


/* *********
 *   ROW   *
 ********* */

// 行相关的参数
const ROW_X = 60;
const ROW_FIRST_Y = TABLE_HEADER_Y + TABLE_HEADER_HEIGHT + TABLE_HEADER_PADDING_TOP_BOTTOM;
/**
 * 每行占的高, dy
 */
const ROW_DY = 36;

const ROW_YEAR_Y = 2;
const ROW_YEAR_X = 135 - ROW_X;
const ROW_YEAR_FONT_SIZE = 24;

/**
 * 相对于 Row 这个元素的位置.
 */
const ROW_PAYLOAD_X = 216 - ROW_X;
const ROW_PAYLOAD_FONT_SIZE = 28;
/**
 * 载荷文字距离右边第一个图标的最小间距 (其实是离图标中心点的位置, 所以这个数值会偏大), dx
 */
const ROW_PAYLOAD_RIGHT_PADDING_DX = 64;

/**
 * 相对于 Row 这个元素的位置.
 */
const ROW_COUNTRY_Y = 2;
const ROW_COUNTRY_X = 0;
const ROW_COUNTRY_HEIGHT = 20;
const ROW_COUNTRY_WIDTH = 44;
const ROW_COUNTRY_FONT_SIZE = 16;

const ROW_LINE_Y = ROW_COUNTRY_HEIGHT / 2 + ROW_COUNTRY_Y;
const ROW_LINE_PADDING_X = 12;
const ROW_LINE_WIDTH = 4;

const ROW_ICON_OVERFLIGHT_X = 560 - ROW_X;
const ROW_ICON_SURROUND_X = 620 - ROW_X;
const ROW_ICON_RETURN_ORBIT_X = 680 - ROW_X;
const ROW_ICON_HARD_LANDING_X = 800 - ROW_X;
const ROW_ICON_SOFT_LANDING_X = 860 - ROW_X;
const ROW_ICON_ROVER_X = 920 - ROW_X;
const ROW_ICON_RETURN_X = 1040 - ROW_X;
const ROW_ICON_MANNED_LANDING_X = 1100 - ROW_X;

const ROW_ICON_INFO_FONT_SIZE = 12;

const ROW_PAYLOAD_FAIL_OPACITY = 0.25;

/** ********
 * Summary *
 ********* */

const SUMMARY_HEIGHT = 90;
const SUMMARY_YEAR_X = 90;
/** 靠底边的 */
const SUMMARY_YEAR_Y = 72;
const SUMMARY_YEAR_FONT_SIZE = 30;
const SUMMARY_YEAR_FONT_SIZE_2 = 20;

const SUMMARY_BAR_X = 390;
/** 靠底边的 */
const SUMMARY_BAR_Y = 42;
const SUMMARY_BAR_Y_2 = 72;
const SUMMARY_BAR_FONT_SIZE = 16;
const SUMMARY_BAR_FONT_SIZE_2 = 26;
const SUMMARY_BAR_OPACITY = 0.7;

/** 中心位置 */
const SUMMARY_ITEM_X = 510;
const SUMMARY_ITEM_DX = 80;
const SUMMARY_ITEM_Y = SUMMARY_BAR_Y - ROW_COUNTRY_HEIGHT;

/** *******
 *  path  *
 ******** */

const PATH_OVERFLIGHT = 'M0-10L10,8H-10Z'; // 三角
const PATH_SURROUND = 'M0-10 a10,10,10,0,1,10,10 a10,10,10,1,1-10-10 z'; // 圆
// 爆炸
const PATH_HARD_LANDING = 'M3-10L2-3L10-5L3,0L9,5L3,3L1,9L-2,4L-8,7L-4,2L-10,2L-3-2L-6-5L-1-3Z';
const PATH_SOFT_LANDING = 'M2-11V-1L7-4L9-1L0,4L-9-1L-7-4L-2-1V-11Z M-10,10h20q-10-10-20,0Z';
const PATH_ROVER =
    'M-1,1l4-4 a5,5,4,0,1,1-7  l3,3 c2-2,4,0,2,2 l3,3  a5,5,4,0,1-7,1 L3,1' +
    'H10v3h1v5h-3 c0,4-6,4-6,0 h-4 c0,4-6,4-6,0 h-3v-5h1v-3' +
    'H-8l1-1h1l1-3  L-6-6l-4,2l-2-4l8-4l2,4l-2,1v1l1,3  L-4,0h1l1,1' +
    'Z' +
    'M2,2l-2,2h9v-2' + // second
    'Z';

const PATH_RETURN = 'M-2,4v-10L-7-3L-9-6L0-11L9-6L7-3L2-6v10Z M-10,10h20q-10-10-20,0Z';
const PATH_PERSON = 'M0-4L5-1 c2,1.2,1,4.2-1,3 L1,0L2,6L3,9 c0.5,1.5-2.5,2.5-3,1 L-1,7'+
    'L-1,10 c0,2-3,2-3,0 L-4,6L-4,.8L-7,2.6 c-2,1.2-3-1.8-1-3 L-3-3.4Z'+
    'M-3.4-1.6 a4.5,4.5,0,1,1,4-.6z'+
    'M0-4 a3,3,0,1,0-3,.6z';

const PATH_FAIL = 'M2,0l8,8 c2,2,0,4-2,2 L0,2l-8,8 c-2,2-4,0-2-2'+
    'L-2,0l-8-8 c-2-2,0-4,2-2 L0-2l8-8 c2-2,4,0,2,2 Z';
const PATH_PARTIALLY = 'M0-2L4-7L6-6L2-1L8-1L8,1L2,1L6,6L4,7'+
    'L0,2L-4,7L-6,6L-2,1L-8,1L-8-1L-2-1L-6-6L-4-7Z';
const PATH_QUESTION = 'M-10-10h20V2H2V5H-2V-2H6V-6H-6v3h-4Z M2,8v4h-4v-4Z';

export default {
  PANEL_WIDTH, FOOTER_HEIGHT,

  TABLE_HEADER_Y, TABLE_HEADER_HEIGHT, TABLE_HEADER_PADDING_TOP_BOTTOM,
  TABLE_HEADER_TEXT_HEIGHT, TABLE_HEADER_FONT_SIZE, TABLE_HEADER_TEXT_PADDING_RIGHT,
  TABLE_HEADER_ICON_OPACITY,
  TABLE_HEADER_TEXT_Y, TABLE_HEADER_ICON_Y,
  TABLE_FOOTER_TEXT_Y, TABLE_FOOTER_ICON_Y,

  ROW_X,
  ROW_FIRST_Y, ROW_DY,
  ROW_YEAR_X, ROW_YEAR_Y, ROW_YEAR_FONT_SIZE,
  ROW_PAYLOAD_X, ROW_PAYLOAD_FONT_SIZE, ROW_PAYLOAD_RIGHT_PADDING_DX,
  ROW_COUNTRY_X, ROW_COUNTRY_Y, ROW_COUNTRY_WIDTH, ROW_COUNTRY_HEIGHT, ROW_COUNTRY_FONT_SIZE,
  ROW_LINE_Y, ROW_LINE_PADDING_X, ROW_LINE_WIDTH,
  ROW_ICON_INFO_FONT_SIZE,
  ROW_PAYLOAD_FAIL_OPACITY,

  SUMMARY_HEIGHT,
  SUMMARY_YEAR_X, SUMMARY_YEAR_Y, SUMMARY_YEAR_FONT_SIZE, SUMMARY_YEAR_FONT_SIZE_2,
  SUMMARY_BAR_X, SUMMARY_BAR_Y, SUMMARY_BAR_FONT_SIZE, SUMMARY_BAR_OPACITY,
  SUMMARY_BAR_Y_2, SUMMARY_BAR_FONT_SIZE_2,
  SUMMARY_ITEM_X, SUMMARY_ITEM_DX, SUMMARY_ITEM_Y,

  iconXs : {
    overflight : ROW_ICON_OVERFLIGHT_X,
    surround : ROW_ICON_SURROUND_X,
    return_orbit : ROW_ICON_RETURN_ORBIT_X,
    landing_hard : ROW_ICON_HARD_LANDING_X,
    landing_soft : ROW_ICON_SOFT_LANDING_X,
    landing_rover : ROW_ICON_ROVER_X,
    return_land : ROW_ICON_RETURN_X,
    manned_land : ROW_ICON_MANNED_LANDING_X,
  },

  paths : {
    overflight : PATH_OVERFLIGHT,
    surround : PATH_SURROUND,
    landing_hard : PATH_HARD_LANDING,
    landing_soft : PATH_SOFT_LANDING,
    landing_rover : PATH_ROVER,
    return_land : PATH_RETURN,
    return_orbit : PATH_RETURN,
    fail : PATH_FAIL,
    partially : PATH_PARTIALLY,
    manned_land : PATH_PERSON,
    question : PATH_QUESTION,
  },

  countries : [
    {
      key : 'USA',
      color : '#4488DD',
      name : '美国',
    },
    {
      key : 'USSR',
      color : '#FFBB44',
      name : '苏联',
    },
    {
      key : 'RUS',
      color : '#7F337F',
      name : '俄罗斯',
    },
    {
      key : 'JP',
      color : '#88AA66',
      name : '日本',
    },
    {
      key : 'EU',
      color : '#907C71',
      name : '欧空局',
    },
    {
      key : 'IN',
      color : '#FF7788',
      name : '印度',
    },
    {
      key : 'CN',
      color : '#DD3333',
      name : '中国',
    },
    {
      key : 'IL',
      color : '#44CCCC',
      name : '以色列',
    },
    {
      key : 'KR',
      color : '#996699',
      name : '南朝鲜',
    },
    {
      key : 'UAE',
      color : '#996699',
      name : '阿联酋',
    },
  ],
};
